let menu=[
  {xingming:'张三',bumen:'维修一部',work:'电工',qiandao:'08:58:51',qiantui:'18:08:36',state:'正常',time:'2021-12-23'},
  {xingming:'李四',bumen:'维修二部',work:'机修',qiandao:'08:52:23',qiantui:'18:08:36',state:'正常',time:'2021-12-23'},
  {xingming:'李斯',bumen:'维修三部',work:'电工',qiandao:'08:52:23',qiantui:'18:08:36',state:'正常',time:'2021-12-23'},
  {xingming:'阿迪',bumen:'维修二部',work:'机修',qiandao:'08:57:23',qiantui:'18:08:36',state:'正常',time:'2021-12-23'},
  {xingming:'尼克',bumen:'维修一部',work:'电工',qiandao:'09:18:51',qiantui:'18:08:36',state:'迟到',time:'2021-12-23'},
  {xingming:'铁牛',bumen:'维修二部',work:'机修',qiandao:'09:08:51',qiantui:'18:08:36',state:'迟到',time:'2021-12-23'},
  {xingming:'张三',bumen:'维修一部',work:'电工',qiandao:'08:58:51',qiantui:'18:08:36',state:'正常',time:'2021-12-24'},
  {xingming:'李四',bumen:'维修二部',work:'机修',qiandao:'09:52:23',qiantui:'18:08:36',state:'迟到',time:'2021-12-24'},
  {xingming:'李斯',bumen:'维修三部',work:'电工',qiandao:'08:52:23',qiantui:'18:08:36',state:'正常',time:'2021-12-24'},
  {xingming:'阿迪',bumen:'维修二部',work:'机修',qiandao:'08:57:23',qiantui:'18:08:36',state:'正常',time:'2021-12-24'},
  {xingming:'尼克',bumen:'维修一部',work:'电工',qiandao:'09:28:51',qiantui:'18:08:36',state:'迟到',time:'2021-12-24'},
  {xingming:'铁牛',bumen:'维修二部',work:'机修',qiandao:'09:08:51',qiantui:'18:08:36',state:'迟到',time:'2021-12-24'},
  {xingming:'张三',bumen:'维修一部',work:'电工',qiandao:'08:58:51',qiantui:'18:08:36',state:'正常',time:'2021-12-25'},
  {xingming:'李四',bumen:'维修二部',work:'机修',qiandao:'08:52:23',qiantui:'18:08:36',state:'正常',time:'2021-12-25'},
  {xingming:'李斯',bumen:'维修三部',work:'电工',qiandao:'08:52:23',qiantui:'18:08:36',state:'正常',time:'2021-12-25'},
  {xingming:'阿迪',bumen:'维修二部',work:'机修',qiandao:'08:57:23',qiantui:'18:08:36',state:'正常',time:'2021-12-25'},
  {xingming:'尼克',bumen:'维修一部',work:'电工',qiandao:'08:48:51',qiantui:'18:08:36',state:'正常',time:'2021-12-25'},
  {xingming:'铁牛',bumen:'维修二部',work:'机修',qiandao:'08:48:51',qiantui:'18:08:36',state:'正常',time:'2021-12-25'},
]
let newDate=menu
function showMenu(data){
  $('#tbody').html('')
  $.each(data,(index,item)=>{
    $('#tbody').append(`
    <tr>
    <td class="col-md-2 item">${item.xingming}</td> 
    <td class="col-md-2 item">${item.bumen}</td> 
    <td class="col-md-2 item">${item.work}</td> 
    <td class="col-md-2 item">${item.qiandao}</td> 
    <td class="col-md-2 item">${item.qiantui}</td> 
    <td class="col-md-2 item">${item.state}</td> 
    </tr>
    `)
})
}
showMenu(newDate)
//查询
$('#chaxun').click(function (){
  let data1=$('#input_2').val()
  let data2
  let data3
  newDate=[]
  for (let i = 0; i <menu.length; i++) {
  if(menu[i].xingming==data1){
    newDate.push(menu[i])
    showMenu(newDate)
  }else if(menu[i].bumen==data2){}
  else if(menu[i].state==data3){}
  }
 })
 //重置
 $('#chongzhi').click(function () {
  showMenu(menu)
})